<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('新增OA角色映射对接系统')" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-centreRole-add">
            <input name="centreSysId" type="hidden" th:value="${centreSysId}" />
           <!-- <div class="form-group">    
                <label class="col-sm-3 control-label is-required">OA角色id：</label>
                <div class="col-sm-8">
                    <input name="oaRoleId" class="form-control" type="text" required>
                </div>
            </div>-->

            <div class="form-group">
                <label class="col-sm-3 control-label is-required">OA角色id：</label>
                <input type="hidden" id="oaRoleId" name="oaRoleId">
                <div class="col-sm-8">
                    <div class='input-group'>
                        <input name="title" id="title" class="form-control"  readonly></input>
                        <span  id="selectDictTree" class='input-group-addon input-sm' onclick='selectDictTree2()'>
                                <i class='fa fa-search' >选择</i>
                    	</span>
                    </div>
                </div>
            </div>
            
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">角色名称：</label>
                <div class="col-sm-8">
                    <input name="roleName" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">角色id：</label>
                <div class="col-sm-8">
                    <input name="roleId" class="form-control" type="number" required>
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-3 control-label ">备注：</label>
                <div class="col-sm-8">
                    <textarea name="remark" class="form-control" ></textarea>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <script type="text/javascript">
        var prefix = ctx + "centre/centreRole"
        $("#form-centreRole-add").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/add", $('#form-centreRole-add').serialize());
            }
        }

        // 选择字典处理函数
        function selectDictTree2() {
            // alert("awefwewfew");
            var url = ctx + "system/role/selectTree";
            var options = {
                title: 'OA角色',
                width: "380",
                url: url,
                callBack: doSubmit
            };
            $.modal.openOptions(options);
        }

        function doSubmit(index, layero){

            var body = layer.getChildFrame('body', index);
            var oaRoleId = body.find('#id').val();
            var title = body.find('#title').val();

            layer.close(index);
            $("#oaRoleId").val(oaRoleId);
            $("#title").val(title);
        }
        
    </script>
</body>
</html>